1. Technical Field
The invention is related to image processing in general, and more particularly, to a system and process for improving the uniformity in exposure and tone of a digital image using a unique histogram equalization procedure referred to as locally adapted histogram equalization.
2. Background Art
Digital cameras suffer from several deficiencies when compared with traditional photographic film. Among these are a lower dynamic range and a resulting inconsistency in the uniformity of both exposure and tone across an image captured by current digital cameras.
FIG. 1 presents a digital image which will be used to explain the dynamic range problem. FIG. 1 shows an image of the interior of an office. Specifically, this image was captured with a Kodak DCS-40 camera. The image of FIG. 1 represents an image taken at what was considered the xe2x80x9cproperxe2x80x9d exposure. Notice how the image contains areas that appear to be underexposed or overexposed. For example, the trees seen through the window appear to be overexposed, while the objects on the desk appear to be underexposed.
Histogram equalization is a popular technique in image processing that has been used in the past to mitigate the effects of the aforementioned inconsistency in the uniformity of the exposure and tone of a digital image. For example, histogram equalization can be used to stretch or compress the brightness of the pixels making up an image based on the overall distribution of pixel brightnesses in the image. This equalization process tends to produce a more balanced, realistic looking image having an extended dynamic range and more uniform exposure and tone characteristics. A traditional histogram equalization process involves creating a count of the number of pixels exhibiting a particular pixel brightness level (also known as the luminous intensity value) in an image. From this count, a cumulative distribution function is computed and normalized to a maximum value corresponding to the number of pixel brightness levels employed. The cumulative distribution function is then used as a lookup table to map from the original pixel brightness levels to final levels.
However, while this traditional histogram equalization technique is useful, it is generated from the entire image and so does not mimic the spatially localized adaptation present in the human visual system.
The present invention implements a novel histogram equalization approach called locally adapted histogram equalization to overcome the aforementioned shortcoming of the global histogram equalization methods currently employed. The goal of this new approach is to produce a digital image exhibiting improved uniformity in exposure and tone by employing histogram equalization on a localized basis, i.e., to have the stretching and compression of pixel brightness levels be adapted to a local distribution of pixels in the image.
This approach is embodied in a system and process that first segments the digital image into a plurality of image patches. For each of these patches, a pixel brightness level histogram is created which identifies a respective pixel count for each of the plurality of original pixel brightness levels exhibited by the pixels of the patch. The histogram for each patch is then optionally averaged with the histograms associated with a prescribed number of neighboring image patches. A normalized cumulative distribution function is generated based on the averaged histogram. This function is essentially a standard cumulative distribution function which has been normalized such that the maximum cumulative count value corresponds to the maximum original pixel brightness level. The normalized cumulative distribution function identifies a respective new pixel brightness level for each of the original pixel brightness levels. These new pixel brightness levels are represented by the normalized pixel count value corresponding to each respective original pixel brightness level. For each of the original pixel brightness levels, the associated new pixel brightness levels from a prescribed number of neighboring image patches is preferably blended. While this blending is preferred, it could be skipped if the aforementioned optional histogram averaging is performed. Preferably, the blending is accomplished using a bilinear interpolator function, or a biquadratic interpolator function. If so, the amount of blending will depend on the relative position of the pixel within its patch. Finally, for each image patch, the original pixel brightness level of each pixel in the image patch is replaced with the blended pixel brightness level corresponding to that original brightness level. This produces a final image exhibiting the aforementioned improved uniformity in exposure and tone.
A further refinement can also be implemented to mitigate the effects of noise caused by areas of a single color in the scene depicted in the patch. In one embodiment, this refinement entails employing a partially equalization approach. Partial equalization can be described as the blending of the aforementioned normalized cumulative distribution function with a straight line function. While the foregoing blending operation does mitigate the effects of noise, it may not produce the optimum improvement in exposure and tone in the final image. Thus, it is preferred that the degree noise reduction be controlled by selecting the percentage of blending of the straight line function with the cumulative distribution function which produces the optimum improvement in exposure and tone (i.e. any blend between 0% and 100% is possible).
In another embodiment, the refinement entails limiting the gain exhibited by any of the blended pixel brightness levels associated with an image patch, in comparison to its, associated original pixel brightness level, to a prescribed level. This prescribed level is chosen so as to mitigate the effects of noise caused by areas of a single color in the scene depicted in the image patch while still producing the optimum improvement in exposure and tone.